/* 表格和弹出框美化样式 */

/* 数据表格容器 */
.data-table-wrapper {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* 表格头部 */
.data-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    background-color: #fafafa;
}

.data-table-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.data-table-actions {
    display: flex;
    gap: 12px;
}

/* 搜索框 */
.search-input {
    padding: 10px 15px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    width: 250px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-input:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
    outline: none;
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.data-table th {
    background-color: #fafafa;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: background-color 0.3s;
    position: relative;
}

.data-table th:hover {
    background-color: #f0f0f0;
}

.data-table th::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}

.data-table th.sort-asc::after {
    content: '↑';
}

.data-table th.sort-desc::after {
    content: '↓';
}

.data-table tr:hover {
    background-color: #f5f5f5;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* 表格中的操作按钮 */
.data-table .actions {
    display: flex;
    gap: 8px;
}

/* 分页样式 */
.data-table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

.pagination-buttons {
    display: flex;
    gap: 8px;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn i {
    margin-right: 6px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-primary {
    background-color: #1890ff;
    color: white;
}

.btn-primary:hover {
    background-color: #40a9ff;
    box-shadow: 0 2px 6px rgba(24, 144, 255, 0.2);
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.btn-edit {
    background-color: #52c41a;
    color: white;
}

.btn-edit:hover {
    background-color: #73d13d;
    box-shadow: 0 2px 6px rgba(82, 196, 26, 0.2);
}

.btn-delete {
    background-color: #ff4d4f;
    color: white;
}

.btn-delete:hover {
    background-color: #ff7875;
    box-shadow: 0 2px 6px rgba(255, 77, 79, 0.2);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: modalBackgroundFadeIn 0.3s;
}

@keyframes modalBackgroundFadeIn {
    from {
        background-color: rgba(0, 0, 0, 0);
    }
    to {
        background-color: rgba(0, 0, 0, 0.5);
    }
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 8% auto;
    padding: 0;
    border-radius: 8px;
    width: 60%;
    max-width: 800px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    animation: modalFadeIn 0.3s;
    overflow: hidden;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fafafa;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.close {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
    background-color: #fafafa;
}

.modal-footer .btn {
    margin-left: 10px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
    outline: none;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8.825L1.175 4 2.05 3.125 6 7.075 9.95 3.125 10.825 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* 图片预览 */
.image-preview {
    margin-top: 15px;
    max-width: 200px;
    max-height: 200px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.image-upload {
    margin-top: 10px;
}

/* 消息提示 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    min-width: 250px;
}

.message::before {
    margin-right: 10px;
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}

.message-success {
    background-color: #52c41a;
}

.message-success::before {
    content: '\f00c';
}

.message-error {
    background-color: #ff4d4f;
}

.message-error::before {
    content: '\f00d';
}

.message-info {
    background-color: #1890ff;
}

.message-info::before {
    content: '\f129';
}

/* 空状态 */
.empty-state {
    padding: 40px 0;
    text-align: center;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #e0e0e0;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}